package com.tech.koufu.ui.widiget;

import com.tech.koufu.R;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class CofDialog {

	private Dialog mDialog;
	private TextView messageTxt;
	public TextView answerTxt;
	public TextView positive;
	public TextView negative;

	public CofDialog(Context context, String message, String result) {
		LayoutInflater inflater = LayoutInflater.from(context);
		View view = inflater.inflate(R.layout.dialog_cuslayout, null);

		mDialog = new Dialog(context, R.style.MyDialog);
		mDialog.setContentView(view);

		messageTxt = (TextView) view.findViewById(R.id.dialog_message);
		messageTxt.setText(message+"=");

		answerTxt = (EditText) view.findViewById(R.id.dialog_message_result);

		positive = (TextView) view.findViewById(R.id.yes);
		negative = (TextView) view.findViewById(R.id.no);
	}

	public CofDialog(Context context, int layout) {
		LayoutInflater inflater = LayoutInflater.from(context);
		View view = inflater.inflate(R.layout.dialog_cofool_txt, null);
		mDialog = new Dialog(context, R.style.MyDialog);
		mDialog.setContentView(view);
		positive = (TextView) view.findViewById(R.id.yes);
		negative = (TextView) view.findViewById(R.id.no);
	}

	public void show() {
		mDialog.show();
	}

	public void dismiss() {
		mDialog.dismiss();
	}

	public String getAnswer() {
		return answerTxt.getText().toString();
	}

}
